/*
 *         Copyright (c) KUBOTA Corporation and HUDSON SOFT,
 *                  1994, 1995 All Rights Reserved
 *
 *  This software comprises unpublished confidential information of
 *  KUBOTA Corp. and HUDSON SOFT. It may not be used, copied or made 
 *  available to anyone, except in accordance with the license under
 *  which it is furnished.
 */
static char SccsId[] = "@(#)aorotysc.c	1.6	9/19/95";
#include <farl.h>
#include <agl.h>

/*
 * 引数で与えられたsin, cosでオブジェクトをＹ軸回転
 */
void
AGLRotateObjYSC(object *obj, fix1015 SinYY, fix1015 CosYY)
{
     fix187		siny187, cosy187;

     if (SinYY == 0 && CosYY == 0x7fff) return;

     /* 現在のObjToWorld187マトリクスに、Ｙ軸回転を掛ける	*/
     siny187 = CONV1015TO187(SinYY);
     cosy187 = CONV1015TO187(CosYY);
     if (obj->objChanged == -2) {
	  FarlGetRotateYSC4x4M187(siny187, cosy187, (unsigned short*)obj->objToWorld187);
     } else {
	  FarlSetSrcMatrix((unsigned short*)obj->objToWorld187);
	 FarlRotateYSC4x4M187(siny187, cosy187);
	 FarlCopyDstToMem4x4((unsigned short*)obj->objToWorld187);
     }

     /* 現在のObjToWorld1015マトリクスに、Ｙ軸回転を掛ける	*/
     if (obj->objChanged < 0) {
	  FarlGetRotateYSC3x3M1015(SinYY, CosYY,
	  			(unsigned short*)obj->objToWorld1015);
     } else {
	  FarlSetSrcMatrix3x3((unsigned short*)obj->objToWorld1015);
	 FarlRotateYSC3x3M1015(SinYY, CosYY);
	 FarlCopyDstToMem3x3((unsigned short*)obj->objToWorld1015);
     }
     obj->objChanged = 1;
}
